<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			
	
		//二维数组
//			var arr = [];
//			arr[0] = [1, 2, 3]
//			arr[1] = [4, 5, 6]
//			arr[2] = [7, 8, 9]
//			console.log(arr[2][2]);
//			var sum = 0
//			for(var i = 0; i < arr.length; i++) {
//
//				for(var k = 0; k < arr[i].length; k++) {
//
//					sum += arr[i][k]
//
//				}
//			}
//			console.log(sum)
//			//三维数组
			var arr = [
				[
					[1, 2, 3],
					[4, 5, 6],
					[7, 8, 9]
				],
				[
					[11, 12, 13],
					[14, 15, 16],
					[17, 18, 19]
				],
				[
					[21, 22, 23],
					[24, 25, 26],
					[27, 28, 29]
				],
			];
			console.log(arr[0][2][2]);
			var sum=0;
			for (var m=0;m<arr.length;m++) {
				for (var t=0;t<arr[m].length;t++) {
					for (var s=0; s<arr[m][t].length;s++) {
						sum+=arr[m][t][s]
					}
				}
			}
			console.log(sum)
				</script>
	</body>
</html>
